<?php

namespace App\Service\Common;

use App\Exception\ApiException;
use App\Model\CpsWallet;
use App\Model\Spread\SpreadAccount;
use Hyperf\Di\Annotation\Inject;
abstract class SpreadCoinOperateInterface
{
    use \Hyperf\Di\Aop\ProxyTrait;
    use \Hyperf\Di\Aop\PropertyHandlerTrait;
    function __construct()
    {
        $this->__handlePropertyHandler(__CLASS__);
    }
    /**
     *@Inject
     * @var CpsWallet
     */
    protected CpsWallet $cpsWallet;
    /**
     * @Inject
     * @var SpreadAccount
     */
    protected SpreadAccount $spreadAccount;
    /**
     * 检查num是否正确
     * @param $num
     * @return void
     */
    protected function checkNum($num) : void
    {
        if ($num < 0) {
            throw new ApiException('数值错误');
        }
    }
    public abstract function inc(int $sId, string $amount, string $argument, string $description = '');
    public abstract function dec(int $sId, string $amount, string $argument, string $description = '');
}